﻿#include <iostream>
#include "IBuilder.hpp"

QCUSTOM_API void BUILDER_CALL QBUILDER_ON_BUILD(IMCBuilder* iBuilder, IMCBuildContext* iContext)
{
	// CPP中可以使用封装的View类型以简化操作
	QAddon::MCBuilderView builder = iBuilder;
	QAddon::MCBuildContextView context = iContext;
	// 请确保该TASK在MANIFEST中被分配了PATH否则抛出异常
	for (const auto& path : context.getBuildPath().getAllFiles())
	{
		// 这将读取MANIFEST中分配的Path目录下的所有JSON文件
		if (path.getFileName().ends_with(".json"))
		{
			std::cout << path.readText() << "\n";
		}
	}
}